package com.blue.integration.serve.aliyun;

import com.blue.core.util.DateUtil;
import com.blue.integration.serve.VehicleLicense;

public class AliyunVehicleLicense
{
	private static final String DATE_FORMET = "yyyyMMdd";

	private String owner; // 所有人名称
	private String plate_num; // 车牌号码
	private String vehicle_type; // 车辆类型
	private String model; // 品牌型号
	private String vin; // 车辆识别代号
	private String engine_num; // 发动机号码
	private String register_date; // 注册日期
	private String issue_date; // 发证日期

	private boolean success;

	public AliyunVehicleLicense()
	{
	}

	public VehicleLicense toVehicleLicense()
	{
		VehicleLicense license = new VehicleLicense();
		license.setOwner(owner);
		license.setPlateNum(plate_num);
		license.setVehicleType(vehicle_type);
		license.setModel(model);
		license.setVin(vin);
		license.setEngineNum(engine_num);

		if (register_date != null && !register_date.isEmpty())
			license.setRegisterDate(DateUtil.parse(register_date, DATE_FORMET));
		
		if (issue_date != null && !issue_date.isEmpty())
			license.setIssueDate(DateUtil.parse(issue_date, DATE_FORMET));

		return license;
	}

	public String getOwner()
	{
		return owner;
	}

	public void setOwner(String owner)
	{
		this.owner = owner;
	}

	public String getPlate_num()
	{
		return plate_num;
	}

	public void setPlate_num(String plate_num)
	{
		this.plate_num = plate_num;
	}

	public String getVehicle_type()
	{
		return vehicle_type;
	}

	public void setVehicle_type(String vehicle_type)
	{
		this.vehicle_type = vehicle_type;
	}

	public String getModel()
	{
		return model;
	}

	public void setModel(String model)
	{
		this.model = model;
	}

	public String getVin()
	{
		return vin;
	}

	public void setVin(String vin)
	{
		this.vin = vin;
	}

	public String getEngine_num()
	{
		return engine_num;
	}

	public void setEngine_num(String engine_num)
	{
		this.engine_num = engine_num;
	}

	public String getRegister_date()
	{
		return register_date;
	}

	public void setRegister_date(String register_date)
	{
		this.register_date = register_date;
	}

	public boolean isSuccess()
	{
		return success;
	}

	public void setSuccess(boolean success)
	{
		this.success = success;
	}

	public String getIssue_date()
	{
		return issue_date;
	}

	public void setIssue_date(String issue_date)
	{
		this.issue_date = issue_date;
	}

}
